<?php
include("config.php");
$result=mysql_query("SELECT * FROM image WHERE id='$_GET[id]'") or die(mysql_error()); 
$row=mysql_fetch_array($result);
if(!$row){
	$result=mysql_query("SELECT * FROM image_update WHERE `id`='$_GET[up_id]'") or die(mysql_error()); 
	$row=mysql_fetch_array($result);
}
$picture = "up_image/".$_GET['type']."/".$row['img_path'];
$PSize = filesize($picture);
$mysqlPicture = fread(fopen($picture,"r"), $PSize);
//echo $picture;
Header( "Content-type: image/gif");
echo $mysqlPicture;
?>